import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutterstudyapplast/manager/app_manager.dart';
import 'package:flutterstudyapplast/ui/page/page_article.dart';

class SplashPage extends StatefulWidget {
  @override
  _SplashPageState createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    init();
  }
  void init() async{
    Iterable<Future> futures = [AppManager.initApp(),Future.delayed(Duration(seconds: 3))];
    await Future.wait(futures);
    Navigator.pushReplacement(context, MaterialPageRoute(builder: (context){
      return ArticlePage();
    }));
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(child: Image.asset("assets/images/splash.png"),)
    );
  }
}
